package com.bwie.controller;

import com.bwie.common.domain.Goods;
import com.bwie.common.domain.response.GoodsResp;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import com.bwie.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @className: GoodsController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 郑伦
 * @date: 2025/7/31 10:29
 */
@RestController
public class GoodsController {

    @Autowired
    GoodsService goodsService;

    /**
     * 商品活动列表
     * @param goodsResp
     * @return
     */
    @PostMapping("/goodsList")
    public Result<PageResult<Goods>> goodsList(@RequestBody GoodsResp goodsResp){
        PageResult<Goods> listPageResult = goodsService.goodsList(goodsResp);
        return Result.success(listPageResult);
    }
}